<template>
  <div class="container-fluid p-0 m-0" style="background:black">
    <van-tag v-for="(item, index) of this.infoPlayer" :key=index :type=item.type :color=item.color :text-color=item.textcolor :plain=item.plain :size="onpc?'large':''">{{item.text}}</van-tag>
  </div>
</template>

<script>
/* eslint-disable comma-dangle */
export default {
  data: function () {
    return this.gdata.data
  },
  components: {
    // websocket: websocket
  },
  methods: {
  },
  computed: {
    gendercolor: function () {
      return this.pbase.Gender === '男性' ? 'deepskyblue' : 'hotpink'
    },
    familycolor: function () {
      var conf = this.conf.ConfigFamily[this.pbase.Family]
      if (typeof (conf) === 'undefined') {
        return 'black'
      }
      return conf.Color
    },
    infoPlayer: function () {
      if (this.onpc) {
        return [
          { color: this.gendercolor, textcolor: 'black', text: this.pbase.Name },
          { color: this.gendercolor, textcolor: 'black', text: this.pbase.Gender },
          { color: this.gendercolor, textcolor: 'black', text: this.pbase.Age + '岁' },
          { color: this.familycolor, textcolor: 'black', text: this.pbase.Family },
          { color: this.confex.cfglevel(this.pbase.Level).Color, text: this.confex.cfglevel(this.pbase.Level).Desc },
          { color: '#FFFF00', textcolor: 'black', text: '通宝 ' + this.pbase.Gem },
          { color: '#EBEB48', textcolor: '#000000', text: '银钱 ' + this.pbase.Gold },
          { type: 'success', text: '潜能 ' + this.pbase.Pot },
          { type: 'warning', textcolor: '#000000', text: 'Vip' + this.pbase.VipLevel }
        ]
      } else {
        return [
          { color: this.confex.cfglevel(this.pbase.Level).Color, text: this.confex.cfglevel(this.pbase.Level).Desc },
          { color: '#FFFF00', textcolor: 'black', text: '通宝 ' + this.pbase.Gem },
          { color: '#EBEB48', textcolor: '#000000', text: '银钱 ' + this.pbase.Gold },
          { type: 'success', text: '潜能 ' + this.pbase.Pot },
        ]
      }
    }
  }
}
</script>

<style scoped>
</style>
